<!-- 防疫弹框 -->
<template>
  <div>
    <div class="haPop homeBox" v-if="showModal">
      <div class="haPop_con">
        <div class="icon__close homeBox_close" @click="showModal = false">
          <img src="@/assets/images/icon_close.svg" alt="" class="img" />
        </div>
        <div class="haPop_con_content">
          <p class="haPop_con_content_title">防疫提示</p>
          <p class="p">根据国家防疫政策本次展会暂缓开展。</p>
          <br />
          <!-- web -->
          <p style="text-align: center" class="xs-hide"><a :href="link" class="go2Detail homeBox_close" target="_blank">点击查看</a></p>
          <!-- wap -->
          <p style="text-align: center" class="sm-hide"><a :href="link" class="go2Detail homeBox_close" target="_blank">点击查看</a></p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getConfigs } from "@/api/common";
export default {
  props: {},
  data() {
    return {
      showModal: true,//内部控制器
      link: "",//详情链接
    };
  },
  mounted() {
    this.getConfigsFun();
  },
  methods: {
    getConfigsFun() {
      this.invoke(getConfigs, "modal_link").then((res) => {
        if (res && res.code == 200) {
          if (res.data) {
            const configData = res.data;
            this.link = configData.modal_link;
          }
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.haPop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999999999;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f2f4f699;
  &_con {
    width: 800px;
    height: 400px;
    padding: 100px 4px 0;
    position: relative;
    top: -10%;
    margin: 0 50px 0 0;
    border: 1px solid #d53b76;
    background: #fff;
    box-sizing: border-box;
    &_content {
      background: rgba(255, 255, 255, 0.9);
      padding: 6px;
      &_title {
        font-weight: bold;
        text-align: center;
        font-size: 24px;
        color: #d53b76 !important;
      }
    }
  }
  .p {
    font-weight: bold;
    font-size: 20px;
    word-break: break-all;
    text-align: center;
    line-height: 28px;
  }
  p {
    color: #333;
  }
}

.icon__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  &:hover{
    background-color: #d3d3d333;
    border-radius: 50%;
  }
  .img {
    max-width: 100%;
  }
}

.go2Detail {
  background: #d53b76;
  font-size: 16px;
  display: inline-block;
  padding: 12px 24px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 30px;

  &:hover {
    color: #ffffff;
  }
}

@media (max-width: 767px) {
  .haPop {
    top: 150px;
    left: 0;
    width: 100%;
    &_con {
      padding-top: 20px;
      width: 60%;
      float: none;
      margin: 0 auto;
      padding: 4px;
      height: auto;
      &_content {
        padding: 8px;
      }
    }
  }

  .haPop__con__content__title {
    font-size: 24px;
  }

  .go2Detail {
    padding: 10px 20px;
  }
}

/* wap */
@media (max-width: 750px) {
  .xs-hide {
    display: none;
  }

  .xs-hidei {
    display: none !important;
  }

  .xs-show {
    display: block;
  }

  .xs-showi {
    display: block !important;
  }

  /* wap 端加回车，即显示为多行 */
  .xs-br {
    display: block;
  }

  /* wap端居中 */
  .xs-center {
    text-align: center;
  }
}

/*  web */
@media (min-width: 768px) {
  .sm-hide {
    display: none;
  }

  .sm-hidei {
    display: none !important;
  }

  .sm-show {
    display: block;
  }

  /* web 端加回车，即显示为多行 */
  .sm-br {
    display: block;
  }

  /* wap端居中 */
  .sm-center {
    text-align: center;
  }
}
</style>
